
JAVA_HOME=/usr/lib/jvm/java-6-sun
CLASSPATH=".:../lib/:${JAVA_HOME}/jre/lib/plugin.jar"
STORE_ALIAS=micovery
STORE_PASS="STORE_PASS"

all: Client.jar

Client.jar: build/Client.class build/Connection.class build/Packet.class
	cp -r lib/* build; cd build; jar cvmf ../src/Manifest  Client.jar *; mv Client.jar  ../
	jarsigner -storepass ${STORE_PASS} Client.jar ${STORE_ALIAS}

build/Client.class: src/Client.java
	cd src; export CLASSPATH=${CLASSPATH}; javac Client.java -d ../build; cd ..
     
build/Connection.class: src/Connection.java
	cd src; javac Connection.java -d ../build; cd ..

build/Packet.class: src/Packet.java
	cd src; javac Packet.java -d ../build; cd ..

clean:
	rm -rf build/* Client.jar
